Get premium membership and access questions with answers, video lessons as well as revision papers.

Modify the following program so that all member functions are automatically in-lined: #include using namespace std; class myclass { int i, j; public: myclass (int x, int y); void show(); }; myclass ::...

      

Modify the following program so that all member functions are automatically in-lined:
#include
using namespace std;
class myclass {
int i, j;
public:
myclass (int x, int y);
void show();
};
myclass :: myclass(int x, int y)
{
i=x;
j=y;
}
void myclass :: show()
{
cout << i << " " <}
int main()
{
myclass count (2, 3);
count.show();
return 0;
}

  

Answers


Davis

#include
using namespace std;
class myclass {
int i, j;
public:
myclass (int x, int y) {i=x; j=y;}
void show() {cout << i << " " << j;}
};
int main()
{
myclass count (2, 3);
count.show();
return 0;
}
Githiari answered the question on May 12, 2018 at 16:34


Next: What does the following program display? #include using namespace std; int main() { int i = 10; long 1 = 1000000; double d = -0.0009; cout << i << ' ' <<1<<...
Previous: Is the following fragment valid? union { float f; unsigned int bits; };

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions